<?php if(! defined("BASEPATH")) exit("No direct access allowed!");
	
class Sign_model extends CI_Model {
	private $signdb='sign';
    public function __construct()
   	{
        $this->load->database();
	    parent::__construct();
    }
    public function sign($userid){
        $this->db->where('user_id',$userid);
        $this->db->set('last_date', date("Y-m-d"));
        $this->db->set('sign_time','sign_time+1',FALSE);
        if($this->db->update('sign')) return;
        else $this->load->view('unittest','error');
    }
    public function join($data){
        $result = $this->db->insert('sign', $data);
        return $result;
}
}
?>